package top.hidoctor.auscultation.feature.activity;

import android.os.Bundle;
import android.support.v4.app.FragmentTransaction;
import android.widget.FrameLayout;

import top.hidoctor.auscultation.R;
import top.hidoctor.auscultation.base.BaseActivity;
import top.hidoctor.auscultation.bean.PatientLocalInfo;
import top.hidoctor.auscultation.feature.fragment.patient.PatientFragment;

public class PatientsActivity extends BaseActivity {
    FrameLayout container;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.act_patients);
        initEvent();
    }

    private void initEvent() {
        PatientLocalInfo info = (PatientLocalInfo) getIntent().getSerializableExtra("info");
        FragmentTransaction transaction = getSupportFragmentManager().beginTransaction();
        PatientFragment cartFragment = new PatientFragment();
        Bundle bundle = new Bundle();
        bundle.putString("from", "caiji");
        bundle.putSerializable("info", info);
        cartFragment.setArguments(bundle);
        transaction.add(R.id.container, cartFragment).commitAllowingStateLoss();
    }
}
